<!DOCTYPE html>
<html lang="zh-cn">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<meta name="renderer" content="webkit">
<title></title>
  <style>
    .paging_simple_numbers{text-align:center;margin-top:20px;margin-bottom: 20px;}
    .paging_simple_numbers .pagination li{margin:0px 10px; border:1px solid #e6e6e6;padding: 3px 8px;display: inline-block;}
    .paging_simple_numbers .pagination .active{background-color: rgba(35,162,219,0.98);color: #fff;}
    .paging_simple_numbers .pagination .disabled{color:#aaa;}
  </style>
    {include file="public/header"/}
</head>
<body>
  <div class="panel admin-panel">
    <div class="panel-head"><strong class="icon-reorder"> 订单列表</strong> <a href="" style="float:right; display:none;">添加字段</a></div>
    <div class="padding border-bottom">
    	<form id="F" action="" method="get">
      <ul class="search" style="padding-left:10px;">
        <li><a class="button border-main icon-plus-square-o" href="order_recycle.html"> 回收站</a></li>
        <li>搜索：</li>
        <li>
          <span>价格区间</span>
          <input type="nummber" name="order_amount_min" placeholder="请输入最小价格" value="<{$data['order_amount_min']|default=''}>">-
          <input type="nummber" name="order_amount_max" placeholder="请输入最大价格" value="<{$data['order_amount_max']|default=''}>">
        </li>
        <li>
          <span>订单状态</span>
          &nbsp;&nbsp;&nbsp;
          {foreach name="status" item="v"}

          <input type="checkbox" name="status_id[]" <{:in_array($v['status_id'],$status_id)?'checked':''}> value="<{$v['status_id']}>"  ><{$v['order_status']}>

          {/foreach}
        </li>
        <li>
          <input type="text" placeholder="请输入搜索订单号" name="order_sn" class="input" style="width:250px; line-height:17px;display:inline-block" value="<{$data['order_sn']|default=''}>" />
          <a href="javascript:F.submit();" class="button border-main icon-search" > 搜索</a></li>
      </ul>
      </form>
    </div>
    <table class="table table-hover text-center">
      <tr>
        <th width="150" style="text-align:left; padding-left:20px;">ID</th>
        <th width="10%">订单号</th>
        <th width="10%">用户</th>
        <th width="10%">价格</th>
        <th width="15%">状态</th>
        <th width="20%">下单时间</th>
        <th width="20%">备注</th>
        <th width="310">操作</th>
      </tr>
        {volist name="dd" id="v" empty="$empty"}
        <tr>
          <td style="text-align:left; padding-left:20px;"><input type="checkbox" name="id[]" class="order_id" value="<{$v['order_id']}>" /><{$v['order_id']}></td>

          <td><{$v['order_sn']|raw}></td>
          <td><{$v['buyer_name']}></td>
          <td><{$v['order_amount']}></td>
          <td><font color="#00CC99"><{$v['order_statuss']}></font></td>
          <td><{$v['add_date']}></td>
          <td><{$v['postscript']}></td>
          <td><div class="button-group"> <a class="button border-main" href="order_detail.html"><span class="icon-edit"></span> 查看</a> <a class="button border-red" href="<{:url('del',['id'=>$v['order_id']])}>" onclick="return del(1,1,1)"><span class="icon-trash-o"></span> 删除</a> </div></td>
        </tr>
        {/volist}
      <tr>

      <tr>
        <td style="text-align:left; padding:19px 0;padding-left:20px;"><input type="checkbox" id="checkall"/>
          	全选 
        </td>
        <td colspan="7" style="text-align:left;padding-left:20px;">
        	<a href="javascript:DelSelect()" class="button border-red icon-trash-o" style="padding:5px 15px;" onclick="DelSelect()"> 删除</a>
        </td>
      </tr>

    </table>
  </div>
  <{$dd|raw}>
<script type="text/javascript">
    // 单个删除
    function del(id,mid){
        if(confirm("您确定要删除吗?")){

        }else{
            return false;
        }
    }

//搜索
function changesearch(){	
		
}



//全选
$("#checkall").click(function(){ 
  $("input[name='id[]']").each(function(){
	  if (this.checked) {
		  this.checked = false;
	  }
	  else {
		  this.checked = true;
	  }
  });
})

    //批量删除
    $(".button").click(function(){
        var arr=[];
        $(".order_id").each(function (index,object) {
            if($(object).prop("checked")){
                arr.push($(object).val());
            }
        })

        if(arr.length>0){
            if(confirm("确认删除吗？")){
                location.href="all_del?id="+arr.join(",");
            }
        }
    })

//批量排序
function sorts(){
	var Checkbox=false;
	 $("input[name='id[]']").each(function(){
	  if (this.checked==true) {		
		Checkbox=true;	
	  }
	});
	if (Checkbox){	
		
		$("#listform").submit();		
	}
	else{
		alert("请选择要操作的内容!");
		return false;
	}
}


//批量首页显示
function changeishome(o){
	var Checkbox=false;
	 $("input[name='id[]']").each(function(){
	  if (this.checked==true) {		
		Checkbox=true;	
	  }
	});
	if (Checkbox){
		
		$("#listform").submit();	
	}
	else{
		alert("请选择要操作的内容!");		
	
		return false;
	}
}

//批量推荐
function changeisvouch(o){
	var Checkbox=false;
	 $("input[name='id[]']").each(function(){
	  if (this.checked==true) {		
		Checkbox=true;	
	  }
	});
	if (Checkbox){
		
		
		$("#listform").submit();	
	}
	else{
		alert("请选择要操作的内容!");	
		
		return false;
	}
}

//批量置顶
function changeistop(o){
	var Checkbox=false;
	 $("input[name='id[]']").each(function(){
	  if (this.checked==true) {		
		Checkbox=true;	
	  }
	});
	if (Checkbox){		
		
		$("#listform").submit();	
	}
	else{
		alert("请选择要操作的内容!");		
	
		return false;
	}
}


//批量移动
function changecate(o){
	var Checkbox=false;
	 $("input[name='id[]']").each(function(){
	  if (this.checked==true) {		
		Checkbox=true;	
	  }
	});
	if (Checkbox){		
		
		$("#listform").submit();		
	}
	else{
		alert("请选择要操作的内容!");
		
		return false;
	}
}

//批量复制
function changecopy(o){
	var Checkbox=false;
	 $("input[name='id[]']").each(function(){
	  if (this.checked==true) {		
		Checkbox=true;	
	  }
	});
	if (Checkbox){	
		var i = 0;
	    $("input[name='id[]']").each(function(){
	  		if (this.checked==true) {
				i++;
			}		
	    });
		if(i>1){ 
	    	alert("只能选择一条信息!");
			$(o).find("option:first").prop("selected","selected");
		}else{
		
			$("#listform").submit();		
		}	
	}
	else{
		alert("请选择要复制的内容!");
		$(o).find("option:first").prop("selected","selected");
		return false;
	}
}

</script>
</body>
</html>